import { ref } from 'vue'
import { cartListReq } from '@/api/cart'
import { getlocalStorage } from '@/utils/localStorage'
let cartArr = ref([])
let userid = getlocalStorage.userid
async function loadCartList() {
  let r = await cartListReq(userid)
  if (r.data.data) {
    cartArr.value = r.data.data
  } else {
    cartArr.value = []
  }
}
export { loadCartList, cartArr }
